using System;
using System.Collections.Generic;
using System.Text;
using System.Xml.Serialization;

namespace BizTalk.ESB.Extensions.Validation.Helpers
{
    public partial class ValidationResults
    {
        public void AddValidationItem(String Name, String Value, String Entity, String Action
            , String Identifier, String Message, String ResultCode, String ValidationType)
        {
            List<ValidationResultsElement> temp = new List<ValidationResultsElement>();
            if (this.Elements != null)
            {
                temp.AddRange(this.Elements);
            }

            ValidationResultsElement item = new ValidationResultsElement();
            item.Action = Action;
            item.Entity = Entity;
            item.Identifier = Identifier;
            item.ResultCode = ResultCode;
            item.Type = ValidationType;
            item.Description = Message;
            item.Name = Name;
            item.Value = Value;
            temp.Add(item);
            this.Elements = temp.ToArray();
        }
    }
}
